package com.guigu.contentservice.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 文章表（存储平台发布的资讯、指南等内容）
 * </p>
 *
 * @author zcy
 * @since 2025-09-27
 */
public class Article implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 文章唯一标识
     */
    @TableId(value = "article_id", type = IdType.AUTO)
    private Long articleId;

    /**
     * 文章标题（用于前端展示，需吸引用户点击）
     */
    private String articleTitle;

    /**
     * 关联文章分类表category_id（确定文章所属分类）
     */
    private Long categoryId;

    /**
     * 文章内容（富文本格式，支持图片、视频、链接）
     */
    private String articleContent;

    /**
     * 文章封面图URL（用于列表页展示，提升吸引力）
     */
    private String coverImage;

    /**
     * 发布状态（0-草稿，1-已发布）
     */
    private Boolean publishStatus;

    /**
     * 发布时间（publish_status=1时必填，记录文章上线时间）
     */
    private LocalDateTime publishTime;

    /**
     * 浏览次数（统计文章被查看的次数）
     */
    private Integer viewCount;

    /**
     * 记录创建时间
     */
    private LocalDateTime createTime;

    /**
     * 记录更新时间
     */
    private LocalDateTime updateTime;

    public Long getArticleId() {
        return articleId;
    }

    public void setArticleId(Long articleId) {
        this.articleId = articleId;
    }

    public String getArticleTitle() {
        return articleTitle;
    }

    public void setArticleTitle(String articleTitle) {
        this.articleTitle = articleTitle;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public String getArticleContent() {
        return articleContent;
    }

    public void setArticleContent(String articleContent) {
        this.articleContent = articleContent;
    }

    public String getCoverImage() {
        return coverImage;
    }

    public void setCoverImage(String coverImage) {
        this.coverImage = coverImage;
    }

    public Boolean getPublishStatus() {
        return publishStatus;
    }

    public void setPublishStatus(Boolean publishStatus) {
        this.publishStatus = publishStatus;
    }

    public LocalDateTime getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(LocalDateTime publishTime) {
        this.publishTime = publishTime;
    }

    public Integer getViewCount() {
        return viewCount;
    }

    public void setViewCount(Integer viewCount) {
        this.viewCount = viewCount;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "Article{" +
        "articleId = " + articleId +
        ", articleTitle = " + articleTitle +
        ", categoryId = " + categoryId +
        ", articleContent = " + articleContent +
        ", coverImage = " + coverImage +
        ", publishStatus = " + publishStatus +
        ", publishTime = " + publishTime +
        ", viewCount = " + viewCount +
        ", createTime = " + createTime +
        ", updateTime = " + updateTime +
        "}";
    }
}
